package jdk7;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author honway.liu
 * @date 2018/4/30 下午9:11
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class Sort2 {

    public static void main(String[] args) {
        List<Account> accounts = Arrays.asList(new Account("Justin", "X1234", 100),
                                                new Account("Monica", "X5678", 120),
                                                new Account("Irene", "X2468", 3000));
        Collections.sort(accounts);
        System.out.println(accounts);


        List<String> strings = Arrays.asList("B", "X", "A", "E", "O", "S", "P", "Z");
        Collections.sort(strings);
        System.out.println(strings);

        Collections.sort(strings, (o1, o2) -> -o1.compareTo(o2));
        System.out.println(strings);


    }
}
